/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kwikMart.business;

import com.kwikMart.accesData.MedioPago;
import com.kwikMart.accesData.TipoDocumento;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author WIL
 */
@Stateless
public class ParametricasEJB implements ParametricasEJBLocal, Serializable {

    @PersistenceContext(unitName = "Kwik-E-Mart-ejbPU")
    private EntityManager em;

    public List<TipoDocumento> getListTDocumento() {
        List<TipoDocumento> resultado = new ArrayList<>();
        try {
            resultado = em.createNamedQuery("TipoDocumento.findAll").getResultList();
        } catch (Exception e) {
        }
        return resultado;
    }

    public List<MedioPago> getListMedioPago() {
        List<MedioPago> resultado = new ArrayList<>();
        try {
            resultado = em.createNamedQuery("MedioPago.findAll").getResultList();
        } catch (Exception e) {
        }
        return resultado;
    }

    public void persist(Object object) {
        em.persist(object);
    }

}
